package de.hhkk.view;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.nebula.widgets.calendarcombo.CalendarCombo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

public class UIVorlage extends Composite
{
    private Text  text;
    private Text  text_1;
    private Table table;

    /**
     * Create the composite.
     * @param parent
     * @param style
     */
    public UIVorlage(Composite parent, int style, String title)
    {
        super(parent, style);
        setLayout(new GridLayout(1, false));

        TabFolder tabFolder = new TabFolder(this, SWT.NONE);
        GridData gd_tabFolder = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
        gd_tabFolder.heightHint = 495;
        gd_tabFolder.widthHint = 697;
        tabFolder.setLayoutData(gd_tabFolder);
        tabFolder.setBounds(0, 0, 122, 43);

        TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
        tbtmNewItem.setText(title);

        Composite composite = new Composite(tabFolder, SWT.NONE);
        tbtmNewItem.setControl(composite);
        composite.setLayout(new GridLayout(1, false));

        Group group = new Group(composite, SWT.NONE);
        GridData gd_group = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
        gd_group.heightHint = 172;
        gd_group.widthHint = 660;
        group.setLayoutData(gd_group);
        group.setText("Suchkriterien");
        group.setBounds(0, 0, 650, 227);
        group.setLayout(new GridLayout(6, false));

        Label label = new Label(group, SWT.NONE);
        label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        label.setText("Name");

        text = new Text(group, SWT.BORDER);
        GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
        gd_text.widthHint = 140;
        text.setLayoutData(gd_text);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);

        Label label_1 = new Label(group, SWT.SEPARATOR);
        label_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 4));
        new Label(group, SWT.NONE);

        Label label_2 = new Label(group, SWT.NONE);
        label_2.setText("Datum von");

        CalendarCombo calendarCombo = new CalendarCombo(group, SWT.NONE);

        Label label_4 = new Label(group, SWT.NONE);
        label_4.setText("Datum bis");

        CalendarCombo calendarCombo_1 = new CalendarCombo(group, SWT.NONE);
        new Label(group, SWT.NONE);

        Label label_5 = new Label(group, SWT.NONE);
        label_5.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        label_5.setText("Anzahl Teilnehmer");

        text_1 = new Text(group, SWT.BORDER);
        text_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label label_7 = new Label(group, SWT.NONE);
        label_7.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        label_7.setText("Sprache");

        Combo combo = new Combo(group, SWT.NONE);
        combo.setItems(new String[]{"Deutsch", "Englisch", "Italienisch"});
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Button button = new Button(group, SWT.NONE);
        button.setText("Suchen");

        Label label_8 = new Label(group, SWT.NONE);
        label_8.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));

        Label label_9 = new Label(group, SWT.NONE);
        GridData gd_label_9 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
        gd_label_9.widthHint = 69;
        label_9.setLayoutData(gd_label_9);
        Label label_3 = new Label(group, SWT.NONE);
        label_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        Label label_6 = new Label(group, SWT.NONE);
        label_6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);

        Group group_1 = new Group(composite, SWT.NONE);
        group_1.setText("Trefferliste");
        group_1.setBounds(0, 0, 650, 252);
        group_1.setLayout(new GridLayout(1, false));

        TableViewer tableViewer = new TableViewer(group_1, SWT.BORDER | SWT.FULL_SELECTION);
        table = tableViewer.getTable();
        table.setLinesVisible(true);
        table.setHeaderVisible(true);
        GridData gd_table = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1);
        gd_table.widthHint = 657;
        gd_table.heightHint = 203;
        table.setLayoutData(gd_table);

        TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tableColumn = tableViewerColumn.getColumn();
        tableColumn.setWidth(100);
        tableColumn.setText("Name");
        tableColumn.setResizable(true);
        tableColumn.setMoveable(true);

        Composite composite_1 = new Composite(composite, SWT.NONE);
        GridData gd_composite_1 = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
        gd_composite_1.widthHint = 164;
        composite_1.setLayoutData(gd_composite_1);
        composite_1.setBounds(0, 0, 157, 35);
        composite_1.setLayout(new GridLayout(2, false));

        Button btnNeuanlegen = new Button(composite_1, SWT.NONE);
        btnNeuanlegen.setText("Neu anlegen");

        Button btnSchliessen = new Button(composite_1, SWT.NONE);
        btnSchliessen.addSelectionListener(new SelectionAdapter()
        {
            @Override
            public void widgetSelected(SelectionEvent e)
            {
                dispose();
            }
        });
        btnSchliessen.setText("Schlie\u00DFen");

    }

    @Override
    protected void checkSubclass()
    {
        // Disable the check that prevents subclassing of SWT components
    }
}
